<div class="app flex-row align-items-center">
  <div class="container">
    <div class="row justify-content-center">
      <div class="col-md-8">
        <div class="card-group mb-0">
          <div class="card p-4">
            <form class="card-body" [formGroup]="loginForm" (ngSubmit)="doLogin(loginForm.value, loginForm.valid)">
              <h1>Login</h1>
              <p class="text-muted">Sign In to your account</p>
              <div class="input-group mb-3">
                <span class="input-group-addon"><i class="icon-user"></i></span>
                <input type="text" class="form-control" formControlName="phone" required placeholder="Username">
              </div>
              <div *ngIf="phone.invalid && (phone.dirty || phone.touched)"
                class="alert alert-danger">
                <div *ngIf="phone.errors.required">
                  请填写手机号码
                </div>
                <div *ngIf="phone.errors.validateMobile">
                  手机号码格式不正确
                </div>
              </div>
              <div class="input-group mb-4">
                <span class="input-group-addon"><i class="icon-lock"></i></span>
                <input type="password" class="form-control" formControlName="password" required placeholder="Password">
              </div>
              <div *ngIf="password.invalid && (password.dirty || password.touched)"
                class="alert alert-danger">
                <div *ngIf="password.errors.required">
                  请输入密码
                </div>
              </div>
              <div class="row">
                <div class="col-6">
                  <button class="btn btn-primary px-4" [disabled]="!loginForm.valid" type="submit">Login</button>
                </div>
                <div class="col-6 text-right">
                  <button type="button" class="btn btn-link px-0" >Forgot password?</button>
                </div>
              </div>
            </form>
          </div>
          <div class="card text-white bg-primary py-5 d-md-down-none" style="width:44%">
            <div class="card-body text-center">
              <div>
                <h2>Sign up</h2>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
                <button type="button" class="btn btn-primary active mt-3">Register Now!</button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
